package com.mlnx.work.exception;


import com.mlnx.work.enums.ResponseEnum;

import lombok.Data;

/**
 * Created by amanda.shan on 2019/7/1.
 */
@Data
public class WorkServiceException extends RuntimeException {

    private String code;

    private String describe;

    public WorkServiceException() {
    }

    public WorkServiceException(ResponseEnum responseEnum) {
        super(responseEnum.getDescribe());

        this.code = responseEnum.getCode();
        this.describe = responseEnum.getDescribe();
    }

    public WorkServiceException(String code, String describe) {
        super(describe);

        this.code = code;
        this.describe = describe;
    }

    public WorkServiceException(String message) {
        super(message);
    }

    public WorkServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public WorkServiceException(Throwable cause) {
        super(cause);
    }

    public WorkServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
